package com.zl.smartmall.library.po;

import org.json.JSONException;
import org.json.JSONObject;

public class CountDownInfo {

	private long nowTime;
	private long surplusTime;
	private long endTime;

	public long getNowTime() {
		return nowTime;
	}

	public void setNowTime(long nowTime) {
		this.nowTime = nowTime;
	}

	public long getSurplusTime() {
		return surplusTime;
	}

	public void setSurplusTime(long surplusTime) {
		this.surplusTime = surplusTime;
	}

	public long getEndTime() {
		return endTime;
	}

	public void setEndTime(long endTime) {
		this.endTime = endTime;
	}
	
	public static CountDownInfo parse(JSONObject jsonObject) throws JSONException {
		CountDownInfo countDownInfo = null;
		if(jsonObject != null && jsonObject.length() > 0) {
			countDownInfo = new CountDownInfo();
			countDownInfo.endTime = jsonObject.getLong("endTime");
			countDownInfo.nowTime = jsonObject.getLong("nowTime");
			countDownInfo.surplusTime = jsonObject.getLong("surplusSeconds");
		}
		
		return countDownInfo;
	}
}
